import { translate } from '@/utils/i18n'
import Layout from '@/layout'
// import { Message } from 'element-ui'

// 动态路由
export const asyncRoutes = [
  {
    path: '/',
    component: Layout,
    redirect: '/home',
    meta: { title: translate('homePage'), icon: 'nav_home' },
    children: [{
      path: 'home',
      name: 'Home',
      component: () => import('@/views/home/index'),
      meta: { title: translate('homePage'), icon: 'nav_home' }
    }]
  },
  {
    path: '/profile',
    component: Layout,
    redirect: '/profile/index',
    hidden: true,
    children: [
      {
        path: 'index',
        component: () => import('@/views/profile/index'),
        name: 'Profile',
        meta: { title: translate('grzx'), icon: 'user' }
      }
    ]
  },
  {
    path: '/venueList',
    component: Layout,
    redirect: '/venueList/venueList',
    meta: { title: translate('venueList'), icon: 'nav_changguan', serveName: 'VenueList' },
    children: [{
      path: 'venueList',
      name: 'VenueList',
      component: () => import('@/views/venueList/index'),
      meta: { title: translate('venueList'), icon: 'nav_changguan', serveName: 'VenueList' }
    }
    ]
  },
  {
    path: '/integral',
    component: Layout,
    redirect: '/integral/integralList',
    meta: { title: translate('jfsc'), icon: 'nav_shangpin', serveName: 'Integral' },
    children: [{
      path: 'integralList',
      name: 'IntegralList',
      component: () => import('@/views/integral/shop/index'),
      meta: { title: translate('spgl'), serveName: 'IntegralList' }
    }, {
      path: 'integralAdd',
      name: 'IntegralAdd',
      hidden: true,
      component: () => import('@/views/integral/shop/add.vue'),
      meta: { title: translate('goodsAdd') }
    }, {
      path: 'integralOrder',
      name: 'IntegralOrder',
      component: () => import('@/views/integral/order/index'),
      meta: { title: translate('dhdd'), serveName: 'IntegralOrder' }
    }, {
      path: 'integraldetailed',
      name: 'Integraldetailed',
      component: () => import('@/views/integral/detailed/index'),
      meta: { title: translate('jfmx'), serveName: 'Integraldetailed' }
    }, {
      path: 'shopPickUp',
      name: 'ShopPickUp',
      component: () => import('@/views/integral/shopPickUp/index'),
      meta: { title: translate('selfPick'), serveName: 'ShopPickUp' }
    }]
  },
  {
    path: '/vipCardList',
    component: Layout,
    redirect: '/vipCardList/vipCardList',
    meta: { title: translate('hygl'), icon: 'nav_vipcard', serveName: 'VipCardList' },
    children: [
      {
        path: 'vipList',
        name: 'VipList',
        component: () => import('@/views/vipList/index'),
        meta: { title: translate('hylb'), serveName: 'VipList' }
      },
      {
        path: 'vipDetails',
        name: 'VipDetails',
        hidden: true,
        component: () => import('@/views/vipList/vipDetails/index'),
        meta: { title: translate('hyxq'), serveName: 'VipDetails' }
      },
      {
        path: 'vipCardList',
        name: 'VipCardList',
        component: () => import('@/views/vipCardList/index'),
        meta: { title: translate('hykgl'), serveName: 'VipCardList' }
      },
      {
        path: 'vipCardAdd',
        name: 'VipCardAdd',
        hidden: true,
        component: () => import('@/views/vipCardList/vipCardAdd/index'),
        meta: { title: translate('memberCardAdd') }
      },
      // {
      //   path: 'vipCardAdd',
      //   name: 'VipCardEdit',
      //   hidden: true,
      //   component: () => import('@/views/vipCardList/vipCardAdd/index'),
      //   meta: { title: translate('memberCardEdit') }
      // }
    ]
  },
  {
    path: '/SpecialCard',
    component: Layout,
    redirect: '/SpecialCard/SpecialCardList',
    meta: { title: translate('zxkgl'), icon: 'nav_special', serveName: 'SpecialCard' },
    children: [
      {
        path: 'SpecialCardList',
        name: 'SpecialCardList',
        component: () => import('@/views/orienteering_card'),
        meta: { title: translate('specialCard'), icon: 'nav_special', serveName: 'SpecialCardList' }
      }
    ]
  },
  {
    path: '/marketing',
    component: Layout,
    redirect: '/marketing/marketing',
    meta: { title: translate('marketing'), icon: 'nav_zhengce', serveName: 'Marketing' },
    children: [
      {
        path: 'marketing',
        name: 'Marketing',
        component: () => import('@/views/marketing/index'),
        meta: { title: translate('marketing'), icon: 'nav_zhengce', serveName: 'MarketingList' }
      },
      {
        path: 'marketAdd',
        name: 'MarketAdd',
        hidden: true,
        component: () => import('@/views/marketing/marketAdd/index'),
        meta: { title: translate('policyAdd'), icon: 'nav_zhengce' }
      }
    ]
  },
  {
    path: '/coupon',
    component: Layout,
    redirect: '/coupon/coupon',
    meta: { title: translate('disCoupon'), icon: 'nav_youhuiquan', serveName: 'Coupon' },
    children: [{
      path: 'coupon',
      name: 'Coupon',
      component: () => import('@/views/coupon'),
      meta: { title: translate('disCoupon'), icon: 'nav_youhuiquan', serveName: 'Coupon' }
    }, {
      path: 'couponAdd',
      name: 'CouponAdd',
      hidden: true,
      component: () => import('@/views/couponAdd/index'),
      meta: { title: translate('disCouponAdd'), activeMenu: '/Coupon/CouponAdd' }
    }]
  },
  // {
  //   path: '/devicej',
  //   component: Layout,
  //   redirect: '/devicej/devicej',
  //   meta: { title: translate('rlfx'), icon: 'nav_youhuiquan' },
  //   children: []
  // },
  {
    path: '/combo',
    component: Layout,
    redirect: '/combo/combo',
    meta: { title: translate('tcpz'), icon: 'nav_taocan', serveName: 'Combo' },
    children: [{
      path: 'combo',
      name: 'Combo',
      component: () => import('@/views/combo/index'),
      meta: { title: translate('tcpz'), serveName: 'Combo' }
    }, {
      path: 'comboAdd',
      name: 'ComboAdd',
      hidden: true,
      component: () => import('@/views/comboAdd/index'),
      meta: { title: translate('xztc') }
    }, {
      path: 'comboOrderList',
      name: 'ComboOrderList',
      component: () => import('@/views/combo/comboOrderList/index'),
      meta: { title: translate('ddlb'), serveName: 'ComboOrderList' }
    }
      // ,{
      //   path: 'salesRecord',
      //   name: 'salesRecord',
      //   component: () => import('@/views/combo/salesRecord/index'),
      //   meta: { title: '套餐销售明细' }
      // }
    ]
  },

  {
    path: '/options',
    component: Layout,
    redirect: '/options/optionDefault',
    meta: { title: translate('configAdmin'), icon: 'nav_peizhi', serveName: 'options' },
    children: [
      {
        path: 'optionDefault',
        name: 'OptionDefault',
        component: () => import('@/views/options/optionDefault/index'),
        meta: { title: translate('comminCon'), serveName: 'OptionDefault' }
      },
      {
        path: 'TagOption',
        name: 'TagOption',
        component: () => import('@/views/options/tag_option/index'),
        meta: { title: translate('memberTag'), serveName: 'MemberTagList' }
      },
      {
        path: 'optionVip',
        name: 'OptionVip',
        component: () => import('@/views/options/optionVip/index'),
        meta: { title: translate('memberConfig'), serveName: 'OptionVip' }
      }, {
        path: 'homePageList',
        name: 'HomePageList',
        component: () => import('@/views/options/homePage/index'),
        meta: { title: translate('homeAdver') }
      }, {
        path: 'homePageEdit',
        name: 'HomePageEdit',
        hidden: true,
        component: () => import('@/views/options/homePage/edit.vue'),
        meta: { title: translate('homeAdverAdd') }
      }, {
        path: 'optionPay',
        name: 'OptionPay',
        hidden: true,
        component: () => import('@/views/options/optionPay/index'),
        meta: { title: translate('payParamConfig'), serveName: 'OptionPay' }
      },
      // {
      //   path: 'elecInvoiceConfig',
      //   name: 'ElecInvoiceConfig',
      //   component: () => import('@/views/options/elecInvoiceConfig/index'),
      //   meta: { title: '电子发票配置', serveName: 'ElecInvoiceConfig' }
      // },
      {
        path: 'sportsList',
        name: 'SortsList',
        component: () => import('@/views/options/sports/index'),
        meta: { title: translate('ydzspz'), serveName: 'SortsList' }
      }, {
        path: 'sortsListEdit',
        name: 'SortsListEdit',
        hidden: true,
        component: () => import('@/views/options/sports/edit.vue'),
        meta: { title: translate('sportKnowAdd') }
      }, {
        path: 'noviceHelpList',
        name: 'NoviceHelpList',
        component: () => import('@/views/options/noviceHelp/index'),
        meta: { title: translate('cjwtpz'), serveName: 'NoviceHelp' }
      }, {
        path: 'noviceHelpEdit',
        name: 'NoviceHelpEdit',
        hidden: true,
        component: () => import('@/views/options/noviceHelp/edit.vue'),
        meta: { title: translate('commonQuestionAdd') }
      }, {
        path: 'integralRule',
        name: 'IntegralRule',
        component: () => import('@/views/options/integralRule/index'),
        meta: { title: translate('jfgzpz'), serveName: 'IntegralRule' }
      }, {
        path: 'dictValue',
        name: 'DictValue',
        component: () => import('@/views/options/dictValue/index'),
        meta: { title: translate('dictSet'), serveName: 'DictionaryList' }
      },
      {
        path: 'optionsWonderful',
        name: 'OptionsWonderful',
        hidden: true,
        component: () => import('@/views/options/optionsWonderful/index'),
        meta: { title: translate('jcsj'), serveName: 'OptionsWonderful' }
      },
      // {
      //   path: 'optionsWonderful',
      //   name: 'OptionsWonderful',
      //   hidden: true,
      //   component: () => import('@/views/options/optionsWonderful/index'),
      //   meta: { title: translate('jcsj'), serveName: 'OptionsWonderful' }
      // },
      {
        path: 'RecordWeChat',
        name: 'RecordWeChat',
        // hidden: true,
        component: () => import('@/views/options/RecordWeChat/index'),
        // meta: { title: translate('wxxcxba'), serveName: 'RecordWeChat' }we
        meta: { title: translate('wxxcxba'), serveName: 'ShopMiniProgram' }
      },
      {
        path: 'RecordWeChatEdit',
        name: 'RecordWeChatEdit',
        hidden: true,
        component: () => import('@/views/options/RecordWeChat/edit.vue'),
        // meta: { title: translate('wxxcxba'), serveName: 'RecordWeChat' }
        meta: { title: translate('baxxtx') }
      }
    ]
  },

  {
    path: '/accountOptions',
    component: Layout,
    redirect: '/accountOptions/role',
    meta: { title: translate('zhpz'), icon: 'nav_zhanghao', serveName: 'Role' },
    children: [{
      path: 'roleList',
      name: 'RoleList',
      component: () => import('@/views/role/roleList/index'),
      meta: { title: translate('roleList'), serveName: 'RoleList' }
    }, {
      path: 'roleBind',
      name: 'RoleBind',
      hidden: true,
      component: () => import('@/views/role/roleBind/index'),
      meta: { title: translate('fpqx'), activeMenu: '/accountOptions/role/roleList' }
    },
    {
      path: 'accountList',
      name: 'AccountList',
      component: () => import('@/views/accountList/index'),
      meta: { title: translate('zhlb'), serveName: 'AccountList' }
    }]
  },

  {
    path: '/notice',
    component: Layout,
    redirect: '/notice/noticeSystem',
    meta: { title: translate('noticeGg'), icon: 'nav_tongzhi', serveName: 'Notice' },
    children: [
      {
        path: 'noticeSystem',
        name: 'NoticeSystem',
        component: () => import('@/views/notice/noticeSystem/index'),
        meta: { title: translate('ygtz'), serveName: 'NoticeSystem' }
      }, {
        path: 'noticeVenue',
        name: 'NoticeVenue',
        component: () => import('@/views/notice/noticeVenue/index'),
        meta: { title: translate('memberGg'), serveName: 'NoticeVenue' }
      },
      {
        path: 'noticeFeedback',
        name: 'NoticeFeedback',
        component: () => import('@/views/notice/noticeFeedback/index'),
        meta: { title: translate('yjfk'), serveName: 'NoticeFeedback' }
      },
      {
        path: 'TerraceMessage',
        name: 'TerraceMessage',
        component: () => import('@/views/notice/TerraceMessage'),
        meta: { title: translate('ptxx'), serveName: 'PlatMsgListByShop' }
      }
    ]
  },
  {
    path: '/statistics',
    component: Layout,
    redirect: '/statistics/businessStatistics',
    meta: { title: translate('tjfx'), icon: 'nav_tongji', serveName: 'statistics' },
    children: [{
      path: 'businessStatistics',
      name: 'BusinessStatistics',
      component: () => import('@/views/statistics/businessStatistics/statistic/index'),
      meta: { title: translate('yyjstj'), serveName: 'BusinessStatistics' }
    }, {
      path: 'businessStatisticsEcharts',
      name: 'BusinessStatisticssEcharts',
      component: () => import('@/views/statistics/businessStatistics/charts/echarts'),
      meta: { title: translate('yyjstbtj'), serveName: 'BusinessStatisticssEcharts' }
    }, {
      path: 'businessStatisticsSummary',
      name: 'BusinessStatisticssSummary',
      component: () => import('@/views/statistics/businessStatistics/summary/summary'),
      meta: { title: translate('yyfltj'), serveName: 'BusinessStatisticssSummary' }
    },
    {
      path: 'transactionRecord',
      name: 'TransactionRecord',
      component: () => import('@/views/statistics/memberStatistics'),
      meta: { title: translate('hyxgtj'), serveName: 'TransactionRecord' }
    },
    {
      path: 'OrienteeringStatic',
      name: 'OrienteeringStatic',
      component: () => import('@/views/statistics/orienteering_card'),
      meta: { title: translate('zxkxgtj'), serveName: 'SpecialCardStatistics' }
    },
    {
      path: 'setmealSales',
      name: 'SetmealSales',
      component: () => import('@/views/statistics/setmealStatistics/index'),
      meta: { title: translate('tcxgtj'), serveName: 'SetmealSales' }
    },
    // {
    //   path: 'setmealDetail',
    //   name: 'SetmealDetail',
    //   component: () => import('@/views/statistics/setmealStatistics/setmealDetail/index'),
    //   meta: { title: '套餐售卖明细', serveName: 'SetmealDetail' }
    // },
    {
      path: 'productDistribution',
      name: 'ProductDistribution',
      component: () => import('@/views/statistics/productDistribution/index'),
      meta: { title: translate('cpxsmx'), serveName: 'CourseAndSite' }
    }, {
      path: 'ticketSales',
      name: 'TicketSales',
      component: () => import('@/views/statistics/ticketStatistics/index'),
      meta: { title: translate('mpxgtj'), serveName: 'TicketSales' }
    },
    // {
    //   path: 'ticketDetail',
    //   name: 'TicketDetail',
    //   component: () => import('@/views/statistics/ticketStatistics/ticketDetail/index'),
    //   meta: { title: '门票售卖明细', serveName: 'TicketDetail' }
    // },
    {
      path: 'commoditySales',
      name: 'CommoditySales',
      component: () => import('@/views/statistics/commodityStatistics/index'),
      meta: { title: translate('spxgtj'), serveName: 'CommoditySales' }
    },
    // {
    //   path: 'commodityDetail',
    //   name: 'CommodityDetail',
    //   component: () => import('@/views/statistics/commodityStatistics/commodityDetail/index'),
    //   meta: { title: '商品售卖明细', serveName: 'CommodityDetail' }
    // },
    {
      path: 'curriculumSales',
      name: 'CurriculumRela',
      component: () => import('@/views/statistics/curriculumStatistics/index'),
      meta: { title: translate('kcxgtj'), serveName: 'CurriculumRela' }
    }, {
      path: 'activitySales',
      name: 'ActivityStatistics',
      component: () => import('@/views/statistics/activityStatistics/index'),
      meta: { title: translate('hdxgtj'), serveName: 'ActivityStatistics' }
    },
    // {
    //   path: 'siteUseAnalysis',
    //   name: 'SiteUseAnalysis',
    //   component: () => import('@/views/statistics/fieldStatistics/siteUseAnalysis/index'),
    //   meta: { title: '场地使用分析', serveName: 'FieldStatistics' }
    // },
    {
      path: 'fieldStatisticsDetail',
      name: 'FieldStatisticsDetail',
      component: () => import('@/views/statistics/fieldStatistics/fieldStatisticsDetail/index'),
      meta: { title: translate('ddxgtj'), serveName: 'FieldStatisticsDetail' }
    }, {
      path: 'devicej',
      name: 'Devicj',
      component: () => import('@/views/devicej/index'),
      meta: { title: translate('rlfx'), serveName: 'Devicj' }
    },
    {
      path: 'devicejs',
      name: 'Devicjs',
      component: () => import('@/views/devicej/echarts'),
      hidden: true,
      meta: { title: translate('rlfxtbtj') }
    }, {
      path: 'advPageList',
      name: 'AdvPageList',
      component: () => import('@/views/statistics/advStatistics/advPageList/index'),
      meta: { title: translate('yskqqtj'), serveName: 'AdvPageList' }
    }]
  },
  {
    path: '/logmanager',
    component: Layout,
    redirect: '/logmanager/loginlog',
    meta: { title: translate('logAdmin'), icon: 'nav_rizhiguanli', serveName: 'Logmanager' },
    children: [{
      path: 'loginlog',
      name: 'Loginlog',
      component: () => import('@/views/logmanager/loginlog/index'),
      meta: { title: translate('loginLog'), serveName: 'Loginlog' }
    }, {
      path: 'operatelog',
      name: 'Operatelog',
      component: () => import('@/views/logmanager/operatelog/index'),
      meta: { title: translate('logHandle'), serveName: 'Operatelog' }
    }]
  }, {
    path: '/application',
    component: Layout,
    redirect: '/application/applicationCenter',
    meta: { title: translate('yy'), icon: 'nav_yingyong', serveName: 'ApplicationShop' },
    children: [
      {
        path: 'applicationCenter',
        name: 'ApplicationCenter',
        component: () => import('@/views/application/applicationCenter/index'),
        meta: { title: translate('yyzx'), serveName: 'ApplicationCenterShop' }
      },
      {
        path: 'parkingDisList',
        name: 'ParkingDisList',
        component: () => import('@/views/parkingDisList/index'),
        meta: { title: translate('tcyh'), serveName: 'ParkingDisList' },
        hidden: true
      },
      {
        path: 'shareModule',
        name: 'ShareModule',
        component: () => import('@/views/application/share/index'),
        meta: { title: translate('fxyqhy'), serveName: 'ShareModule' },
        hidden: true
      },
      {
        path: 'taskAdd',
        name: 'TaskAdd',
        component: () => import('@/views/application/share/taskAdmin/components/taskAdd'),
        meta: { title: translate('xzrw') },
        hidden: true
      },
      {
        path: 'taskDetail',
        name: 'TaskDetail',
        component: () => import('@/views/application/share/taskAdmin/components/taskDetail.vue'),
        meta: { title: translate('chakanRask') },
        hidden: true
      },
      {
        path: 'sharePeople',
        name: 'SharePeople',
        component: () => import('@/views/application/share/taskAdmin/components/people.vue'),
        meta: { title: translate('taskPeo'), serveName: 'SharePeople' },
        hidden: true
      },
      {
        path: 'shareOrderDetail',
        name: 'ShareOrderDetail',
        component: () => import('@/views/application/share/taskOrder/detail.vue'),
        meta: { title: translate('fyddmx') },
        hidden: true
      },
      {
        path: 'ElecInvoiceConfig',
        name: 'ElecInvoiceConfig',
        component: () => import('@/views/application/merchantInfo/index.vue'),
        meta: { title: translate('invoiceElec'), serveName: 'ElecInvoiceConfig' },
        hidden: true
      },
      {
        path: 'miniFinish',
        name: 'MiniFinish',
        component: () => import('@/views/application/miniFinish'),
        meta: { title: translate('miniFinish'), serveName: 'MiniFinish' },
        hidden: true
      },
      {
        path: 'DyPublish',
        name: 'DyPublish',
        component: () => import('@/views/application/dyPublish'),
        meta: { title: translate('dyPublish') },
        hidden: true
      },
      {
        path: 'SeckillActive',
        name: 'SeckillActive',
        component: () => import('@/views/application/seckill'),
        meta: { title: translate('skillActivity'), serveName: 'SecKill' },
        hidden: true
      },
      {
        path: 'SecKillOrderList',
        name: 'SecKillOrderList',
        component: () => import('@/views/application/seckill/order.vue'),
        meta: { title: translate('hdOrder') },
        hidden: true
      },
      {
        path: 'SecDiscountOrderList',
        name: 'SecDiscountOrderList',
        component: () => import('@/views/application/discountIng/order.vue'),
        meta: { title: translate('hdOrder') },
        hidden: true
      },
      {
        path: 'SecKillMemberList',
        name: 'SecKillMemberList',
        component: () => import('@/views/application/seckill/subscription.vue'),
        meta: { title: translate('hddyjl') },
        hidden: true
      },
      {
        path: 'SecDiscountMemberList',
        name: 'SecDiscountMemberList',
        component: () => import('@/views/application/discountIng/subscription.vue'),
        meta: { title: translate('hddyjl') },
        hidden: true
      },
      {
        path: 'DiscountIng',
        name: 'DiscountIng',
        component: () => import('@/views/application/discountIng'),
        meta: { title: translate('limitDis'), serveName: 'SecDiscount' },
        hidden: true
      }
    ]
  },
  {
    path: '/sms',
    component: Layout,
    redirect: '/sms/SMSStatistics',
    meta: { title: translate('smsManage'), icon: 'nav_sms', serveName: 'Sms' },
    children: [
      {
        path: 'SMSStatistics',
        name: 'SMSStatistics',
        component: () => import('@/views/SMS/statistics'),
        meta: { title: translate('sysStatic'), serveName: 'SmsStastics' }
      },
      {
        path: 'SMSRechargeRecord',
        name: 'SMSRechargeRecord',
        component: () => import('@/views/SMS/rechargeRecord'),
        meta: { title: translate('czjl'), serveName: 'SmsRechargeRecord' }
      },
      {
        path: 'SMSSendRecord',
        name: 'SMSSendRecord',
        component: () => import('@/views/SMS/sendRecord'),
        meta: { title: translate('smsSendjl'), serveName: 'SmsSendRecord' }
      },
      {
        path: 'SMSTemplate',
        name: 'SMSTemplate',
        component: () => import('@/views/SMS/SMSTemplate'),
        meta: { title: translate('smsTem'), serveName: 'SmsTemplateList' }
      }

    ]
  }
]
